<!doctype html>
<html>
<head>
  <!--
  Adapted from http://almaer.com/blog/embedding-and-reusing-the-bespin-editor-component
  and http://hg.mozilla.org/labs/bespin/file/43ecc1001d47/frontend/tests/editor/singleeditor.html

  Apparently the "syntax" option was changed to "language" somewhere along the line.

  The Bespin team is close to releasing a neatly packaged standalone version of the
  editor. This should be replaced once it is available:
  
  http://groups.google.com/group/bespin/browse_thread/thread/15d7fedd2a7617c8/9bd4ecebfc7dae89?#9bd4ecebfc7dae89
   -->
  <style>body { margin: 0} canvas { outline: none}</style>
  <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.3.2/dojo/dojo.xd.js"></script>
  <script src="https://bespin.mozilla.com/embed.js"></script>
  <script>
    var _editorComponent;
 
    // Loads and configures the objects that the editor needs
    dojo.addOnLoad(function() {
        _editorComponent = new bespin.editor.Component('editor', {
            language: "js",
            loadfromdiv: false
        });

        // Need to subtract 5px to avoid a vertical scroll bar.
        document.getElementById('editor').style.height =
            (document.documentElement.clientHeight - 5) + 'px';
    }); 
  </script>
</head>
<body>

<div id="editor" style="height: 300px;">

</div>

</body>
</html>
